Integrand size = 31, antiderivative size = 91 \[ \int \frac {(A+B \cos (c+d x)) \sec (c+d x)}{\sqrt {a+a \cos (c+d x)}} \, dx=\frac {2 A \text {arctanh}\left (\frac {\sqrt {a} \sin (c+d x)}{\sqrt {a+a \cos (c+d x)}}\right )}{\sqrt {a} d}-\frac {\sqrt {2} (A-B) \text {arctanh}\left (\frac {\sqrt {a} \sin (c+d x)}{\sqrt {2} \sqrt {a+a \cos (c+d x)}}\right )}{\sqrt {a} d} \]
2*A*arctanh(sin(d*x+c)*a^(1/2)/(a+a*cos(d*x+c))^(1/2))/d/a^(1/2)-(A-B)*arc tanh(1/2*sin(d*x+c)*a^(1/2)*2^(1/2)/(a+a*cos(d*x+c))^(1/2))*2^(1/2)/d/a^(1 /2)
Time = 0.05 (sec) , antiderivative size = 72, normalized size of antiderivative = 0.79 \[ \int \frac {(A+B \cos (c+d x)) \sec (c+d x)}{\sqrt {a+a \cos (c+d x)}} \, dx=-\frac {2 \left ((A-B) \text {arctanh}\left (\sin \left (\frac {1}{2} (c+d x)\right )\right )-\sqrt {2} A \text {arctanh}\left (\sqrt {2} \sin \left (\frac {1}{2} (c+d x)\right )\right )\right ) \cos \left (\frac {1}{2} (c+d x)\right )}{d \sqrt {a (1+\cos (c+d x))}} \]
(-2*((A - B)*ArcTanh[Sin[(c + d*x)/2]] - Sqrt[2]*A*ArcTanh[Sqrt[2]*Sin[(c + d*x)/2]])*Cos[(c + d*x)/2])/(d*Sqrt[a*(1 + Cos[c + d*x])])
Time = 0.48 (sec) , antiderivative size = 91, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.226, Rules used = {3042, 3464, 3042, 3128, 219, 3252, 219}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {\sec (c+d x) (A+B \cos (c+d x))}{\sqrt {a \cos (c+d x)+a}} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {A+B \sin \left (c+d x+\frac {\pi }{2}\right )}{\sin \left (c+d x+\frac {\pi }{2}\right ) \sqrt {a \sin \left (c+d x+\frac {\pi }{2}\right )+a}}dx\) |
\(\Big \downarrow \) 3464 |
\(\displaystyle \frac {A \int \sqrt {\cos (c+d x) a+a} \sec (c+d x)dx}{a}-(A-B) \int \frac {1}{\sqrt {\cos (c+d x) a+a}}dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {A \int \frac {\sqrt {\sin \left (c+d x+\frac {\pi }{2}\right ) a+a}}{\sin \left (c+d x+\frac {\pi }{2}\right )}dx}{a}-(A-B) \int \frac {1}{\sqrt {\sin \left (c+d x+\frac {\pi }{2}\right ) a+a}}dx\) |
\(\Big \downarrow \) 3128 |
\(\displaystyle \frac {2 (A-B) \int \frac {1}{2 a-\frac {a^2 \sin ^2(c+d x)}{\cos (c+d x) a+a}}d\left (-\frac {a \sin (c+d x)}{\sqrt {\cos (c+d x) a+a}}\right )}{d}+\frac {A \int \frac {\sqrt {\sin \left (c+d x+\frac {\pi }{2}\right ) a+a}}{\sin \left (c+d x+\frac {\pi }{2}\right )}dx}{a}\) |
\(\Big \downarrow \) 219 |
\(\displaystyle \frac {A \int \frac {\sqrt {\sin \left (c+d x+\frac {\pi }{2}\right ) a+a}}{\sin \left (c+d x+\frac {\pi }{2}\right )}dx}{a}-\frac {\sqrt {2} (A-B) \text {arctanh}\left (\frac {\sqrt {a} \sin (c+d x)}{\sqrt {2} \sqrt {a \cos (c+d x)+a}}\right )}{\sqrt {a} d}\) |
\(\Big \downarrow \) 3252 |
\(\displaystyle -\frac {2 A \int \frac {1}{a-\frac {a^2 \sin ^2(c+d x)}{\cos (c+d x) a+a}}d\left (-\frac {a \sin (c+d x)}{\sqrt {\cos (c+d x) a+a}}\right )}{d}-\frac {\sqrt {2} (A-B) \text {arctanh}\left (\frac {\sqrt {a} \sin (c+d x)}{\sqrt {2} \sqrt {a \cos (c+d x)+a}}\right )}{\sqrt {a} d}\) |
\(\Big \downarrow \) 219 |
\(\displaystyle \frac {2 A \text {arctanh}\left (\frac {\sqrt {a} \sin (c+d x)}{\sqrt {a \cos (c+d x)+a}}\right )}{\sqrt {a} d}-\frac {\sqrt {2} (A-B) \text {arctanh}\left (\frac {\sqrt {a} \sin (c+d x)}{\sqrt {2} \sqrt {a \cos (c+d x)+a}}\right )}{\sqrt {a} d}\) |
(2*A*ArcTanh[(Sqrt[a]*Sin[c + d*x])/Sqrt[a + a*Cos[c + d*x]]])/(Sqrt[a]*d) - (Sqrt[2]*(A - B)*ArcTanh[(Sqrt[a]*Sin[c + d*x])/(Sqrt[2]*Sqrt[a + a*Cos [c + d*x]])])/(Sqrt[a]*d)
3.2.4.3.1 Defintions of rubi rules used
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))* ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (Gt Q[a, 0] || LtQ[b, 0])
Int[1/Sqrt[(a_) + (b_.)*sin[(c_.) + (d_.)*(x_)]], x_Symbol] :> Simp[-2/d Subst[Int[1/(2*a - x^2), x], x, b*(Cos[c + d*x]/Sqrt[a + b*Sin[c + d*x]])], x] /; FreeQ[{a, b, c, d}, x] && EqQ[a^2 - b^2, 0]
Int[Sqrt[(a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]]/((c_.) + (d_.)*sin[(e_.) + ( f_.)*(x_)]), x_Symbol] :> Simp[-2*(b/f) Subst[Int[1/(b*c + a*d - d*x^2), x], x, b*(Cos[e + f*x]/Sqrt[a + b*Sin[e + f*x]])], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0]
Int[((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)])/(Sqrt[(a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]]*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])), x_Symbol] :> Simp[(A *b - a*B)/(b*c - a*d) Int[1/Sqrt[a + b*Sin[e + f*x]], x], x] + Simp[(B*c - A*d)/(b*c - a*d) Int[Sqrt[a + b*Sin[e + f*x]]/(c + d*Sin[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f, A, B}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0]
Leaf count of result is larger than twice the leaf count of optimal. \(271\) vs. \(2(76)=152\).
Time = 4.61 (sec) , antiderivative size = 272, normalized size of antiderivative = 2.99
method | result | size |
default | \(\frac {\cos \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {a \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, \left (A \sqrt {2}\, \ln \left (\frac {2 \sqrt {2}\, a \cos \left (\frac {d x}{2}+\frac {c}{2}\right )+2 \sqrt {2}\, \sqrt {a \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, \sqrt {a}+4 a}{2 \cos \left (\frac {d x}{2}+\frac {c}{2}\right )+\sqrt {2}}\right )+A \sqrt {2}\, \ln \left (-\frac {2 \left (\sqrt {2}\, a \cos \left (\frac {d x}{2}+\frac {c}{2}\right )-\sqrt {2}\, \sqrt {a \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, \sqrt {a}-2 a \right )}{2 \cos \left (\frac {d x}{2}+\frac {c}{2}\right )-\sqrt {2}}\right )-2 \ln \left (\frac {2 \sqrt {a}\, \sqrt {a \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}+2 a}{\cos \left (\frac {d x}{2}+\frac {c}{2}\right )}\right ) A +2 \ln \left (\frac {2 \sqrt {a}\, \sqrt {a \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}+2 a}{\cos \left (\frac {d x}{2}+\frac {c}{2}\right )}\right ) B \right ) \sqrt {2}}{2 \sqrt {a}\, \sin \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {a \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, d}\) | \(272\) |
parts | \(-\frac {A \cos \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {a \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, \left (\sqrt {2}\, \ln \left (\frac {4 \sqrt {a}\, \sqrt {a \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}+4 a}{\cos \left (\frac {d x}{2}+\frac {c}{2}\right )}\right )-\ln \left (\frac {4 \sqrt {2}\, a \cos \left (\frac {d x}{2}+\frac {c}{2}\right )+4 \sqrt {2}\, \sqrt {a \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, \sqrt {a}+8 a}{2 \cos \left (\frac {d x}{2}+\frac {c}{2}\right )+\sqrt {2}}\right )-\ln \left (-\frac {4 \left (\sqrt {2}\, a \cos \left (\frac {d x}{2}+\frac {c}{2}\right )-\sqrt {2}\, \sqrt {a \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, \sqrt {a}-2 a \right )}{2 \cos \left (\frac {d x}{2}+\frac {c}{2}\right )-\sqrt {2}}\right )\right )}{\sqrt {a}\, \sin \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {a \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, d}+\frac {B \cos \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {a \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, \ln \left (\frac {2 \sqrt {a}\, \sqrt {a \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}+2 a}{\cos \left (\frac {d x}{2}+\frac {c}{2}\right )}\right ) \sqrt {2}}{\sqrt {a}\, \sin \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {a \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, d}\) | \(324\) |
1/2*cos(1/2*d*x+1/2*c)*(a*sin(1/2*d*x+1/2*c)^2)^(1/2)*(A*2^(1/2)*ln(2/(2*c os(1/2*d*x+1/2*c)+2^(1/2))*(2^(1/2)*a*cos(1/2*d*x+1/2*c)+2^(1/2)*(a*sin(1/ 2*d*x+1/2*c)^2)^(1/2)*a^(1/2)+2*a))+A*2^(1/2)*ln(-2/(2*cos(1/2*d*x+1/2*c)- 2^(1/2))*(2^(1/2)*a*cos(1/2*d*x+1/2*c)-2^(1/2)*(a*sin(1/2*d*x+1/2*c)^2)^(1 /2)*a^(1/2)-2*a))-2*ln(2*(a^(1/2)*(a*sin(1/2*d*x+1/2*c)^2)^(1/2)+a)/cos(1/ 2*d*x+1/2*c))*A+2*ln(2*(a^(1/2)*(a*sin(1/2*d*x+1/2*c)^2)^(1/2)+a)/cos(1/2* d*x+1/2*c))*B)/a^(1/2)/sin(1/2*d*x+1/2*c)*2^(1/2)/(a*cos(1/2*d*x+1/2*c)^2) ^(1/2)/d
Leaf count of result is larger than twice the leaf count of optimal. 171 vs. \(2 (76) = 152\).
Time = 0.34 (sec) , antiderivative size = 171, normalized size of antiderivative = 1.88 \[ \int \frac {(A+B \cos (c+d x)) \sec (c+d x)}{\sqrt {a+a \cos (c+d x)}} \, dx=-\frac {\sqrt {2} {\left (A - B\right )} \sqrt {a} \log \left (-\frac {\cos \left (d x + c\right )^{2} - \frac {2 \, \sqrt {2} \sqrt {a \cos \left (d x + c\right ) + a} \sin \left (d x + c\right )}{\sqrt {a}} - 2 \, \cos \left (d x + c\right ) - 3}{\cos \left (d x + c\right )^{2} + 2 \, \cos \left (d x + c\right ) + 1}\right ) - A \sqrt {a} \log \left (\frac {a \cos \left (d x + c\right )^{3} - 7 \, a \cos \left (d x + c\right )^{2} - 4 \, \sqrt {a \cos \left (d x + c\right ) + a} \sqrt {a} {\left (\cos \left (d x + c\right ) - 2\right )} \sin \left (d x + c\right ) + 8 \, a}{\cos \left (d x + c\right )^{3} + \cos \left (d x + c\right )^{2}}\right )}{2 \, a d} \]
-1/2*(sqrt(2)*(A - B)*sqrt(a)*log(-(cos(d*x + c)^2 - 2*sqrt(2)*sqrt(a*cos( d*x + c) + a)*sin(d*x + c)/sqrt(a) - 2*cos(d*x + c) - 3)/(cos(d*x + c)^2 + 2*cos(d*x + c) + 1)) - A*sqrt(a)*log((a*cos(d*x + c)^3 - 7*a*cos(d*x + c) ^2 - 4*sqrt(a*cos(d*x + c) + a)*sqrt(a)*(cos(d*x + c) - 2)*sin(d*x + c) + 8*a)/(cos(d*x + c)^3 + cos(d*x + c)^2)))/(a*d)
\[ \int \frac {(A+B \cos (c+d x)) \sec (c+d x)}{\sqrt {a+a \cos (c+d x)}} \, dx=\int \frac {\left (A + B \cos {\left (c + d x \right )}\right ) \sec {\left (c + d x \right )}}{\sqrt {a \left (\cos {\left (c + d x \right )} + 1\right )}}\, dx \]
Time = 0.34 (sec) , antiderivative size = 91, normalized size of antiderivative = 1.00 \[ \int \frac {(A+B \cos (c+d x)) \sec (c+d x)}{\sqrt {a+a \cos (c+d x)}} \, dx=\frac {{\left (\sqrt {2} \log \left (\cos \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + \sin \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 2 \, \sin \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1\right ) - \sqrt {2} \log \left (\cos \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + \sin \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 2 \, \sin \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1\right )\right )} B}{2 \, \sqrt {a} d} \]
1/2*(sqrt(2)*log(cos(1/2*d*x + 1/2*c)^2 + sin(1/2*d*x + 1/2*c)^2 + 2*sin(1 /2*d*x + 1/2*c) + 1) - sqrt(2)*log(cos(1/2*d*x + 1/2*c)^2 + sin(1/2*d*x + 1/2*c)^2 - 2*sin(1/2*d*x + 1/2*c) + 1))*B/(sqrt(a)*d)
Leaf count of result is larger than twice the leaf count of optimal. 165 vs. \(2 (76) = 152\).
Time = 0.35 (sec) , antiderivative size = 165, normalized size of antiderivative = 1.81 \[ \int \frac {(A+B \cos (c+d x)) \sec (c+d x)}{\sqrt {a+a \cos (c+d x)}} \, dx=-\frac {\frac {\sqrt {2} {\left (A \sqrt {a} - B \sqrt {a}\right )} \log \left (\sin \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1\right )}{a \mathrm {sgn}\left (\cos \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )} - \frac {\sqrt {2} {\left (A \sqrt {a} - B \sqrt {a}\right )} \log \left (-\sin \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1\right )}{a \mathrm {sgn}\left (\cos \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )} - \frac {2 \, A \log \left ({\left | \frac {1}{2} \, \sqrt {2} + \sin \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right )}{\sqrt {a} \mathrm {sgn}\left (\cos \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )} + \frac {2 \, A \log \left ({\left | -\frac {1}{2} \, \sqrt {2} + \sin \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right )}{\sqrt {a} \mathrm {sgn}\left (\cos \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{2 \, d} \]
-1/2*(sqrt(2)*(A*sqrt(a) - B*sqrt(a))*log(sin(1/2*d*x + 1/2*c) + 1)/(a*sgn (cos(1/2*d*x + 1/2*c))) - sqrt(2)*(A*sqrt(a) - B*sqrt(a))*log(-sin(1/2*d*x + 1/2*c) + 1)/(a*sgn(cos(1/2*d*x + 1/2*c))) - 2*A*log(abs(1/2*sqrt(2) + s in(1/2*d*x + 1/2*c)))/(sqrt(a)*sgn(cos(1/2*d*x + 1/2*c))) + 2*A*log(abs(-1 /2*sqrt(2) + sin(1/2*d*x + 1/2*c)))/(sqrt(a)*sgn(cos(1/2*d*x + 1/2*c))))/d
Timed out. \[ \int \frac {(A+B \cos (c+d x)) \sec (c+d x)}{\sqrt {a+a \cos (c+d x)}} \, dx=\int \frac {A+B\,\cos \left (c+d\,x\right )}{\cos \left (c+d\,x\right )\,\sqrt {a+a\,\cos \left (c+d\,x\right )}} \,d x \]